package com.example.victory.swagger.model;

import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;

/**
 * 股票持仓信息
 */
@ApiModel(description = "股票持仓信息")
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2021-04-26T10:50:39.083+08:00")

public class StockPosition   {
  @JsonProperty("code")
  private String code = null;

  @JsonProperty("name")
  private String name = null;

  @JsonProperty("marketValueTotal")
  private Double marketValueTotal = null;

  @JsonProperty("profitLoss")
  private Double profitLoss = null;

  @JsonProperty("profitLossRate")
  private Double profitLossRate = null;

  @JsonProperty("hold")
  private Integer hold = null;

  @JsonProperty("cost")
  private Double cost = null;

  @JsonProperty("price")
  private Double price = null;

  public StockPosition code(String code) {
    this.code = code;
    return this;
  }

  /**
   * 股票编号
   * @return code
  **/
  @ApiModelProperty(example = "00061", value = "股票编号")


  public String getCode() {
    return code;
  }

  public void setCode(String code) {
    this.code = code;
  }

  public StockPosition name(String name) {
    this.name = name;
    return this;
  }

  /**
   * 股票名称
   * @return name
  **/
  @ApiModelProperty(example = "长城证券", value = "股票名称")


  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public StockPosition marketValueTotal(Double marketValueTotal) {
    this.marketValueTotal = marketValueTotal;
    return this;
  }

  /**
   * 市值，单位元
   * @return marketValueTotal
  **/
  @ApiModelProperty(example = "1.05", value = "市值，单位元")


  public Double getMarketValueTotal() {
    return marketValueTotal;
  }

  public void setMarketValueTotal(Double marketValueTotal) {
    this.marketValueTotal = marketValueTotal;
  }

  public StockPosition profitLoss(Double profitLoss) {
    this.profitLoss = profitLoss;
    return this;
  }

  /**
   * 盈亏，单位元
   * @return profitLoss
  **/
  @ApiModelProperty(example = "1.05", value = "盈亏，单位元")


  public Double getProfitLoss() {
    return profitLoss;
  }

  public void setProfitLoss(Double profitLoss) {
    this.profitLoss = profitLoss;
  }

  public StockPosition profitLossRate(Double profitLossRate) {
    this.profitLossRate = profitLossRate;
    return this;
  }

  /**
   * 盈亏比率，单位
   * @return profitLossRate
  **/
  @ApiModelProperty(example = "0.05", value = "盈亏比率，单位")


  public Double getProfitLossRate() {
    return profitLossRate;
  }

  public void setProfitLossRate(Double profitLossRate) {
    this.profitLossRate = profitLossRate;
  }

  public StockPosition hold(Integer hold) {
    this.hold = hold;
    return this;
  }

  /**
   * 持有数
   * @return hold
  **/
  @ApiModelProperty(example = "5000", value = "持有数")


  public Integer getHold() {
    return hold;
  }

  public void setHold(Integer hold) {
    this.hold = hold;
  }

  public StockPosition cost(Double cost) {
    this.cost = cost;
    return this;
  }

  /**
   * 成本，单位元
   * @return cost
  **/
  @ApiModelProperty(example = "10.05", value = "成本，单位元")


  public Double getCost() {
    return cost;
  }

  public void setCost(Double cost) {
    this.cost = cost;
  }

  public StockPosition price(Double price) {
    this.price = price;
    return this;
  }

  /**
   * 现价，单位元
   * @return price
  **/
  @ApiModelProperty(example = "11.05", value = "现价，单位元")


  public Double getPrice() {
    return price;
  }

  public void setPrice(Double price) {
    this.price = price;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    StockPosition stockPosition = (StockPosition) o;
    return Objects.equals(this.code, stockPosition.code) &&
        Objects.equals(this.name, stockPosition.name) &&
        Objects.equals(this.marketValueTotal, stockPosition.marketValueTotal) &&
        Objects.equals(this.profitLoss, stockPosition.profitLoss) &&
        Objects.equals(this.profitLossRate, stockPosition.profitLossRate) &&
        Objects.equals(this.hold, stockPosition.hold) &&
        Objects.equals(this.cost, stockPosition.cost) &&
        Objects.equals(this.price, stockPosition.price);
  }

  @Override
  public int hashCode() {
    return Objects.hash(code, name, marketValueTotal, profitLoss, profitLossRate, hold, cost, price);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class StockPosition {\n");
    
    sb.append("    code: ").append(toIndentedString(code)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    marketValueTotal: ").append(toIndentedString(marketValueTotal)).append("\n");
    sb.append("    profitLoss: ").append(toIndentedString(profitLoss)).append("\n");
    sb.append("    profitLossRate: ").append(toIndentedString(profitLossRate)).append("\n");
    sb.append("    hold: ").append(toIndentedString(hold)).append("\n");
    sb.append("    cost: ").append(toIndentedString(cost)).append("\n");
    sb.append("    price: ").append(toIndentedString(price)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}

